package spt.utils;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class ExceptionXMLWriter {
	public static String write(Exception e){
		Document document = XMLUtils.newDocument();
		Element exception = document.createElement("exception");
		exception.setAttribute("name", e.getClass().getName());
		exception.setTextContent(e.getMessage());
		document.appendChild(exception);
		return XMLUtils.transformToString(document);
	}
}
